﻿using Holoville.HOTween;
using Holoville.HOTween.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;


public class AtweenAlpha : Atween
{

    public Tweener to(GameObject target, float duration, float value, EaseType easeType = EaseType.Linear, float delay = 0, TweenDelegate.TweenCallbackWParms callback = null, object[] para = null, bool isFrom = false)
    { 
        Tweener t;
        UIRect rect = target.GetComponent<UIRect>();
        TweenParms p = new TweenParms();
        p.Prop("alpha", value);
        p.Ease(easeType);
        //
        if (delay > 0)
        {
            p.Delay(delay);
        }
        if (callback != null)
        {
            p.OnComplete(callback, para);
        }
        t = HOTween.To(rect, duration, p);
        return t;
    }
}
